#include "widget.h"
#include "./ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->lineEdit->setClearButtonEnabled(true);
    ui->lineEdit_2->setClearButtonEnabled(true);
    ui->lineEdit_3->setClearButtonEnabled(true);

    ui->lineEdit_2->setEchoMode(QLineEdit::Password);

    ui->lineEdit_3->setInputMask("000-0000-0000");
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_clicked()
{
    auto check = ui->radioButton->isChecked();

    qDebug() << "姓名: " << ui->lineEdit->text()
             << "密码: " << ui->lineEdit_2->text()
             << "性别: " << QString(((ui->radioButton->isChecked()) ? "男" : "女")).append(" ")
             << "手机: " << ui->lineEdit_3->text();
}

